﻿<UserControl x:Class="Moonwish.Silverlight.OsAvatar.Desktop"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
             xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
             xmlns:local="clr-namespace:Moonwish.Silverlight.OsAvatar.Controls" 
             xmlns:Controls="clr-namespace:Moonwish.Silverlight.OsAvatar.Controls" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Utility="clr-namespace:Moonwish.Silverlight.OsAvatar.Utility" d:DesignHeight="600" d:DesignWidth="1000">
    <UserControl.Resources>
        <ResourceDictionary Source="BaseStyle.xaml" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="{StaticResource DesktopBackBrush}" >
        <Grid x:Name="grdMain">
            <Grid.Background>
                <ImageBrush x:Name="ibDesktopImage" ImageSource="/Moonwish.Silverlight.OsAvatar;component/Images/win7.jpg" Stretch="Fill"/>
            </Grid.Background>
            <Grid.RowDefinitions>
                <!--桌面高度-->
                <RowDefinition Height="*"/>
                <!--开始键突出按钮高度-->
                <RowDefinition Height="10"/>
                <!--任务栏高度-->
                <RowDefinition x:Name="rdTaskBar" Height="30"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <!--桌面左边距-->
                <ColumnDefinition Width="7"/>
                <!--开始键宽度-->
                <ColumnDefinition Width="40"/>
                <!--任务栏中间宽度-->
                <ColumnDefinition Width="*"/>
                <!--边栏小工具宽度-->
                <ColumnDefinition x:Name="cdSideBar"  Width="54"/>
                <!--系统托盘-->
                <ColumnDefinition x:Name="cdSystemTray" Width="90"/>
            </Grid.ColumnDefinitions>

            <!--桌面应用程序图标容器-->
            <ListBox x:Name="ListboxDesktop" Style="{StaticResource WrapListBox}" Background="Transparent"  Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="3">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <!--Click="btnDesktop_Click"-->
                        <Controls:DblButton x:Name="btnDesktop" DoubleClick="BtnDesktopDoubleClick" Template="{StaticResource ButtonTransparentTemplate}" HorizontalAlignment="Left" Margin="3">
                            <StackPanel>
                                <Image x:Name="Icon" Source="{Binding Icon32, Mode=TwoWay}" Width="40" Height="40" HorizontalAlignment="Center"/>
                                <TextBlock FontSize="12" Foreground="White" Text="{Binding Name, Mode=TwoWay}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" Width="70"/>
                            </StackPanel>
                        </Controls:DblButton>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <!--桌面区域-->
            <Canvas x:Name="CnvDesktop" Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="5">
                
            </Canvas>
            <!--边栏小工具区域-->
            <StackPanel x:Name="StkPanelSideBar" Margin="0,7,7,7" HorizontalAlignment="Right" Grid.Row="0" Grid.RowSpan="2" Grid.Column="3" Grid.ColumnSpan="2">

            </StackPanel>
            <!--任务栏背景-->
            <Border x:Name="brdTaskBarOuter" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="5" BorderBrush="{StaticResource VanguardOuterBorderBrush}"  BorderThickness="0, 1, 0 ,0" >
                <Border x:Name="brdTaskBarInner" BorderBrush="{StaticResource VanguardInnerBorderBrush}" BorderThickness="0, 1, 0 ,0" >
                    <Grid>
                        <Rectangle x:Name="rectTaskBar" Fill="{StaticResource VanguardTaskBarBrush}" RadiusY="0" RadiusX="0" Visibility="Visible" />
                    </Grid>
                </Border>
            </Border>
            <!--开始按钮-->
            <Button x:Name="btnStartMenu" Grid.Row="1" Grid.RowSpan="2" Grid.Column="1" Click="BtnStartMenuClick" Canvas.ZIndex="1" Style="{StaticResource StartButton}" Width="40" Height="40" VerticalAlignment="Bottom" >
                <Button.Background>
                    <ImageBrush x:Name="imgStartMenu" ImageSource="/Moonwish.Silverlight.OsAvatar;component/Icons/start.png" />
                </Button.Background>
            </Button>
            <!--最小化任务栏区域-->
            <StackPanel x:Name="StkPanelTask" Grid.Row="2" Grid.Column="2" Margin="13, 0, 0, 0" Grid.ColumnSpan="2" Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden" />
            <!--右下角托盘开始-->
            <Grid x:Name="grdRightTray" Grid.Row="2" Grid.Column="4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="14"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel x:Name="cnvRightIcons"  Orientation="Horizontal" HorizontalAlignment="Right" Margin="3,0,13,0">
                    <Image x:Name="imgNetwork" Width="24" Height="24" Source="/Moonwish.Silverlight.OsAvatar;component/Icons/network.png" ToolTipService.ToolTip="Connected" />
                    <TextBlock x:Name="tbClock" Foreground="White"  VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" Margin="7,0,0,0" FontFamily="Arial" FontSize="12"/>
                </StackPanel>
                <Button x:Name="btnShowDesktop" Grid.Column="1" Style="{StaticResource ShowDesktopButtonStyle}" ToolTipService.ToolTip="显示桌面"/>
            </Grid>
            <!--右下角托盘结束-->
            <!--程序菜单开始-->
            <Border x:Name="brdStartMenuContainer" Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="5" Background="Transparent" MouseLeftButtonUp="BrdStartMenuContainerMouseLeftButtonUp" Visibility="Collapsed">
                <Border x:Name="brdStartMenu" MouseLeftButtonUp="BrdStartMenuMouseLeftButtonUp" CornerRadius="5, 5, 0, 0" BorderThickness="1" Background="Transparent" BorderBrush="{StaticResource VanguardOuterBorderBrush}" Margin="0, 0, 0, 30" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="410" MaxHeight="550" Height="550">
                    <Border x:Name="brdStartMenuInner" BorderBrush="{StaticResource VanguardInnerBorderBrush}" CornerRadius="5, 5, 0, 0" BorderThickness="1" >
                        <Border x:Name="brdStartMenuRound" CornerRadius="1, 1, 0, 0" BorderThickness="7" VerticalAlignment="Bottom" HorizontalAlignment="Left" MaxHeight="550" Background="{StaticResource VanguardStartMenuBrush}" BorderBrush="{StaticResource VanguardStartMenuBoderBrush}">
                            <StackPanel Orientation="Horizontal">
                                <Border CornerRadius="3" BorderBrush="#FF557689" BorderThickness="1" Background="White">
                                    <Border CornerRadius="3" BorderBrush="#555658" BorderThickness="1" >
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height = "*"></RowDefinition>
                                                <RowDefinition Height = "auto"></RowDefinition>
                                            </Grid.RowDefinitions>
                                            <toolkit:DockPanel Background="Transparent">
                                                <sdk:TreeView  x:Name="tvStartMenu" toolkit:DockPanel.Dock="Top" Height="{Binding Path=Height, ElementName=brdStartMenu, Converter={StaticResource heightFormatter}}" SelectedItemChanged="TvStartMenuSelectedItemChanged" Width="250" Margin="0" Padding="0" BorderThickness="0" ItemContainerStyle="{StaticResource StartTreeViewItemStyle}" Style="{StaticResource StartTreeViewStyle}" >
                                                    <sdk:TreeView.ItemTemplate>
                                                        <sdk:HierarchicalDataTemplate ItemsSource="{Binding Children}" >
                                                            <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" Margin="{Binding Converter={StaticResource marginFormatter}}" HorizontalAlignment="Left" Width="197">
                                                                <Image Source="{Binding Icon32}" Width="32" Height="32"/>
                                                                <TextBlock FontSize="12" VerticalAlignment="Center" Text="{Binding Name}"/>
                                                            </StackPanel>
                                                        </sdk:HierarchicalDataTemplate>
                                                    </sdk:TreeView.ItemTemplate>
                                                </sdk:TreeView>
                                            </toolkit:DockPanel>
                                            <Controls:WatermarkedTextbox x:Name="txtSearch" Grid.Row="1" toolkit:DockPanel.Dock="Bottom" Height="24" Watermark="搜索菜单"  Margin="15, 0, 15, 15"></Controls:WatermarkedTextbox>
                                        </Grid>
                                    </Border>
                                </Border>
                                <toolkit:DockPanel x:Name="dpStartMenuRight" LastChildFill="False"  Background="Transparent">
                                    <Controls:Avatar x:Name="avatarUser" toolkit:DockPanel.Dock="Top" ></Controls:Avatar>
                                    <ListBox x:Name="lbRightStartMenu" ScrollViewer.VerticalScrollBarVisibility="Hidden" toolkit:DockPanel.Dock="Top" HorizontalContentAlignment="Left" Width="150" BorderThickness="0" Background="Transparent" Foreground="White" >
                                        <ListBox.ItemTemplate>
                                            <DataTemplate>
                                                <StackPanel Margin="7,14,0,0" Orientation="Horizontal" VerticalAlignment="Bottom">
                                                    <TextBlock FontSize="12" Text="{Binding Title}"/>
                                                </StackPanel>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>
                                    <!--<HyperlinkButton toolkit:DockPanel.Dock="Top" Background="{Binding Path=BorderBrush, ElementName=brdStartMenu}"  Margin="10,14,0,0" FontSize="12" x:Name="hlbContact" Foreground="White" Click="hlbContact_Click" NavigateUri="mailto:admin@windows4all.com" Content="Contact"/>-->
                                    <StackPanel toolkit:DockPanel.Dock="Bottom"   Height="24"  Margin="7,0,0,0" Orientation="Horizontal">
                                        <Button x:Name="btnShutdown"
																		Style="{StaticResource CloseButtonStyle}"
																		Width="53" Height="24"
																		HorizontalAlignment="Right"
																		Margin="0"
																		VerticalAlignment="Top"
																		HorizontalContentAlignment="Left"
																		VerticalContentAlignment="Top">
                                            <Image Source="/Moonwish.Silverlight.OsAvatar;component/Icons/shutdown.png" />
                                        </Button>
                                        <Button x:Name="btnlock"
																		Style="{StaticResource WindowHeaderButtonStyle}"
																		Width="53" Height="24" Margin="0"
																		VerticalAlignment="Top">
                                            <Image Source="/Moonwish.Silverlight.OsAvatar;component/Icons/lock.png" />
                                        </Button>
                                    </StackPanel>
                                </toolkit:DockPanel>
                            </StackPanel>
                        </Border>
                    </Border>
                </Border>
            </Border>
            <!--程序菜单结束-->

        </Grid>
    </Grid>
</UserControl>
